Skip to main content

TokenGenerationEventFactory

TokenGenerationEventFactory

TGE_INIT_FUNC_SELECTOR

bytes4 TGE_INIT_FUNC_SELECTOR

registry

contract Registry registry

tgeAddresses

address[] tgeAddresses

isExistingTge

mapping(address => bool) isExistingTge

TGEImplAddress

mapping(enum ITokenGenerationEventFactory.SaleType => address) TGEImplAddress

__TokenGenerationEventFactory_init

function __TokenGenerationEventFactory_init(contract Registry _registry, address _factoryAdmin) internal

initialize

function initialize(contract Registry _registry, address _factoryAdmin) public

setFactoryAdmin

function setFactoryAdmin(address _factoryAdmin) public

This function sets the address of the factory admin. Can only be called by the admin role.

Parameters

NameTypeDescription
_factoryAdminaddressThe new address for the factory admin.

setTGEImplAddress

function setTGEImplAddress(enum ITokenGenerationEventFactory.SaleType tgeType, address newImpl) public

_Allows an admin or role holder to set a new implementation address for TokenGenerationEvent contracts of specified type. Requirements:

  • The caller must have admin rights or be assigned with the DEFAULT_ADMIN_ROLE.
  • The newImpl cannot be zero address._

Parameters

NameTypeDescription
tgeTypeenum ITokenGenerationEventFactory.SaleTypeType of TokenGenerationEvent contract to set new implementation for.
newImpladdressNew implementation address to use.

createNewSaleInstance

function createNewSaleInstance(address issuerTokenController, address token, address currency, uint8 saleType, uint256 openingTime) external returns (address)

_This function creates a new sale instance of the specified type. Requirements:

  • The caller must be registered as a securitization manager in the registry.
  • The saleType parameter should be either NORMALSALE_JOT or NORMAL_SALE_SOT.

Parameters

NameTypeDescription
issuerTokenControlleraddressAddress of the Issuer Token Controller contract.
tokenaddressAddress of the note token being sold.
currencyaddressAddress of the currency in which to make the sale.
saleTypeuint8Type of the sale (NORMAL_SALE_JOT or NORMAL_SALE_SOT).
openingTimeuint256The timestamp when the sale should start.

Return Values

NameTypeDescription
[0]addressAddress of the newly created Sale contract.

pauseUnpauseTge

function pauseUnpauseTge(address tgeAdress) external

Pauses or unpauses a TokenGenerationEvent (TGE) contract.

Only callable by an admin role, and only if the TGE exists.

Parameters

NameTypeDescription
tgeAdressaddressThe address of the TGE to be paused/unpaused.

pauseUnpauseAllTges

function pauseUnpauseAllTges() external

This function pauses or unpauses all TokenGenerationEvents (TGEs) based on their current state. If the TGE is currently paused, it will be unpaused; if not, it will be paused.

Only callable by the DEFAULT_ADMIN_ROLE and only when contract is not paused.